Skip to content

[MEX-748] Implement Claim Rewards notifications in xPortal#1598

Merged
claudiulataretu merged 24 commits intofeat/push-notifications-systemfrom
MEX-748-push-notifications
May 15, 2025
Merged

[MEX-748] Implement Claim Rewards notifications in xPortal#1598
claudiulataretu merged 24 commits intofeat/push-notifications-systemfrom
MEX-748-push-notifications

Conversation

@EmanuelMiron
Copy link
Copy Markdown
Contributor

Reasoning

  • There is a new feature on xPortal which allows dapps to send push notifications through the app.

Proposed Changes

  • CronJob which runs once per week and sends notifications to all users that rewards from feesCollector are available to be claimed.

How to test

  • N/A

@EmanuelMiron EmanuelMiron changed the base branch from main to development March 28, 2025 14:39
@EmanuelMiron EmanuelMiron requested a review from Copilot March 28, 2025 14:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a new feature to xPortal that enables dapps to send push notifications about claimable rewards on a weekly cadence. It introduces a notifications module with its related services, models, and configuration updates, as well as integrating the new module into the application bootstrap.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/modules/push-notifications/services/push.notifications.setter.service.ts Implements caching and updating of user energy addresses for notifications
src/modules/push-notifications/push.notifications.service.ts Contains the notification sending logic with a weekly cron job and retry mechanism
src/modules/push-notifications/push.notifications.module.ts Organizes notifications-related services into a dedicated module
src/modules/push-notifications/models/push.notifications.model.ts Defines data models used for energy details and notifications payloads
src/main.ts Integrates the notifications module into the main bootstrap process
src/helpers/api.config.service.ts Adds configuration getters for notifications API url, key, batch size, max retries, chainId, and module activation
Files not reviewed (1)
  • .env.example: Language not supported
Comments suppressed due to low confidence (1)

src/modules/push-notifications/push.notifications.service.ts:238

  • [nitpick] Consider logging the full error object to capture the complete stack trace for debugging purposes rather than just error.message.
this.logger.error('Error in notification cron job:', error.message);

@EmanuelMiron EmanuelMiron changed the title MEX-748 Implement Claim Rewards notifications in xPortal [MEX-748] Implement Claim Rewards notifications in xPortal Mar 28, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 30, 2025

Codecov Report

Attention: Patch coverage is 30.90909% with 38 lines in your changes missing coverage. Please review.

Project coverage is 52.86%. Comparing base (46bc1d0) to head (7084897).
Report is 118 commits behind head on development.

Files with missing lines Patch % Lines
src/helpers/api.config.service.ts 0.00% 9 Missing and 3 partials ⚠️
src/modules/energy/services/energy.abi.service.ts 21.42% 11 Missing ⚠️
...multiversx-communication/mx.xportal.api.service.ts 46.15% 7 Missing ⚠️
src/services/caching/cache.service.ts 0.00% 3 Missing and 2 partials ⚠️
...stic-search/services/es.accounts.energy.service.ts 62.50% 3 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development    #1598      +/-   ##
===============================================
- Coverage        53.07%   52.86%   -0.22%     
===============================================
  Files              279      281       +2     
  Lines            10947    11036      +89     
  Branches           875      881       +6     
===============================================
+ Hits              5810     5834      +24     
- Misses            4353     4412      +59     
- Partials           784      790       +6     
Flag Coverage Δ
unittests 52.86% <30.90%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mad2sm0key
mad2sm0key previously approved these changes May 7, 2025
@claudiulataretu claudiulataretu changed the base branch from development to feat/push-notifications-system May 15, 2025 09:55
@claudiulataretu claudiulataretu merged commit 7ff70ed into feat/push-notifications-system May 15, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants